﻿package core.ui.controls
{
    import core.enum.*;
    import flash.display.*;
    import flash.events.*;

    public class ActionButton extends Sprite
    {
        var bg:Sprite;
        public var action:Action;
        private var marked:Boolean = false;

        public function ActionButton(param1:Tuyitu, param2:String, param3:Action, param4:BitmapData, param5:int, param6:int)
        {
            this.action = param3;
            this.bg = new Sprite();
            this.bg.graphics.beginFill(7961731);
            this.bg.graphics.drawRect(0, 0, 20, 18);
            this.bg.graphics.beginFill(14606822);
            this.bg.graphics.drawRect(1, 1, 18, 16);
            this.bg.graphics.endFill();
            this.bg.alpha = 0;
            addChild(this.bg);
            var _loc_7:* = new IconButton(param1, param2, param4);
            _loc_7.x = param5;
            _loc_7.y = param6;
            addChild(_loc_7);
            this.addEventListener(MouseEvent.ROLL_OVER, this.MouseOver, false, 1, true);
            this.addEventListener(MouseEvent.ROLL_OUT, this.MouseOut, false, 1, true);
            return;
        }// end function

        private function MouseOver(event:MouseEvent) : void
        {
            this.bg.alpha = 1;
            return;
        }// end function

        private function MouseOut(event:MouseEvent) : void
        {
            if (!this.marked)
            {
                this.bg.alpha = 0;
            }
            return;
        }// end function

        public function Mark(param1:Boolean)
        {
            this.marked = param1;
            if (param1)
            {
                this.MouseOver(null);
            }
            else
            {
                this.MouseOut(null);
            }
            return;
        }// end function

    }
}
